package config

// 配置文件结构体
type Configuration struct {
	App     App     `mapstructure:"app" json:"app" yaml:"app"`
	Mysql   Mysql   `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
	Default Default `mapstructure:"default" json:"default" yaml:"default"`
	Jwt     Jwt     `mapstructure:"jwt" json:"jwt" yaml:"jwt"`
}

// APP配置结构体
type App struct {
	Env     string `mapstructure:"env" json:"env" yaml:"env"`
	Port    string `mapstructure:"port" json:"port" yaml:"env"`
	AppName string `mapstructure:"appName" json:"appName" yaml:"appName"`
	AppUrl  string `mapstructure:"appUrl" json:"appUrl" yaml:"appUrl"`
}

// 数据库结构体
type Mysql struct {
	MysqlIM     MysqlIM     `mapstructure:"im" json:"im" yaml:"im"`
	MysqlManage MysqlManage `mapstructure:"manage" json:"manage" yaml:"manage"`
	MysqlGlobal MysqlGlobal `mapstructure:"global" json:"global" yaml:"global"`
}

// 业务数据库配置结构体
type MysqlIM struct {
	Host      string `mapstructure:"host" json:"host" yaml:"host"`
	Port      string `mapstructure:"port" json:"port" yaml:"host"`
	UserName  string `mapstructure:"username" json:"username" yaml:"username"`
	Passowrd  string `mapstructure:"password" json:"password" yaml:"password"`
	Database  string `mapstructure:"database" json:"database" yaml:"database"`
	Charset   string `mapstructure:"charset" json:"charset" yaml:"charset"`
	ParseTime string `mapstructure:"parseTime" json:"parseTime" yaml:"parseTime"`
	Loc       string `mapstructure:"loc" json:"loc" yaml:"loc"`
}

// 后台数据库配置结构体
type MysqlManage struct {
	Host      string `mapstructure:"host" json:"host" yaml:"host"`
	Port      string `mapstructure:"port" json:"port" yaml:"host"`
	UserName  string `mapstructure:"username" json:"username" yaml:"username"`
	Passowrd  string `mapstructure:"password" json:"password" yaml:"password"`
	Database  string `mapstructure:"database" json:"database" yaml:"database"`
	Charset   string `mapstructure:"charset" json:"charset" yaml:"charset"`
	ParseTime string `mapstructure:"parseTime" json:"parseTime" yaml:"parseTime"`
	Loc       string `mapstructure:"loc" json:"loc" yaml:"loc"`
}

// 全局数据库配置结构体
type MysqlGlobal struct {
	Host      string `mapstructure:"host" json:"host" yaml:"host"`
	Port      string `mapstructure:"port" json:"port" yaml:"host"`
	UserName  string `mapstructure:"username" json:"username" yaml:"username"`
	Passowrd  string `mapstructure:"password" json:"password" yaml:"password"`
	Database  string `mapstructure:"database" json:"database" yaml:"database"`
	Charset   string `mapstructure:"charset" json:"charset" yaml:"charset"`
	ParseTime string `mapstructure:"parseTime" json:"parseTime" yaml:"parseTime"`
	Loc       string `mapstructure:"loc" json:"loc" yaml:"loc"`
}

// 默认配置结构体
type Default struct {
	UserName string `mapstructure:"username" json:"username" yaml:"username"`
	Passowrd string `mapstructure:"password" json:"password" yaml:"password"`
}

// jwt配置结构体
type Jwt struct {
	Secret  string `mapstructure:"secret" json:"secret" yaml:"secret"`
	Issuer  string `mapstructure:"issuer" json:"issuer" yaml:"issuer"`
	Subject string `mapstructure:"subject" json:"subject" yaml:"subject"`
}
